<div  ng-controller="TaskListCtrl">
    <div class="app-content-body fade-in-up" infinite-scroll='scrollEvent()' infinite-scroll-disabled="isLoad" infinite-scroll-distance="0" >
        <div class="hbox hbox-auto-xs hbox-auto-sm"   >
            <div class="col w-md bg-light dk b-r bg-auto" >
                <div class="wrapper bg-light lter b-b">
                    <div class="input-group">
                        <input type="text" ng-model="searchValue"  ng-keydown="searchTaskList($event)"  class="form-control input-sm bg-light no-border rounded padder" placeholder="{{'tasks.searchTasks'|translate}}">
                              <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm bg-light rounded" ng-click="searchTaskList()"><i class="fa fa-search"></i></button>
                              </span>
                    </div>
                </div>
                <div class="wrapper"  >
                    <div style="padding-left:10px;margin-bottom: 5px;"  >
                        <span class="text-info"   > <div style="padding-top:10px;padding-bottom:10px;"  ><b ><i class="fa fa-angle-down" ></i>&nbsp;&nbsp;{{'tasks.statusLabel'|translate}}</b></div></span>
                        <ul class="nav nav-pills nav-stacked nav-sm" >
                        <li ng-class="statusFilterClass(0)" >
                            <a   ng-click="setTaskStatus(0)" >
                                <i class="fa fa-fw fa-circle"  style="color: #fad733"  ></i>
                                <span>{{'tasks.status.0'|translate}}</span>
                                <span ng-show="taskCount.status0>0" >&nbsp; [ {{taskCount.status0}} ]</span>
                                <i class="icon-check pull-right filter-close" ></i>
                            </a>
                        </li>
                        <li ng-class="statusFilterClass(1)" >
                            <a   ng-click="setTaskStatus(1)" >
                                <i class="fa fa-fw fa-circle"  style="color: #23b7e5" ></i>
                                <span>{{'tasks.status.1'|translate}}</span>
                                    <span ng-show="taskCount.status1>0" >&nbsp; [ {{taskCount.status1}} ]</span>
                                <i class="icon-check pull-right filter-close" ></i>
                            </a>
                        </li>
                        <li ng-class="statusFilterClass(2)" >
                            <a   ng-click="setTaskStatus(2)" >
                                <i class="fa fa-fw fa-circle" style="color: #27c24c"></i>
                                <span>{{'tasks.status.2'|translate}}</span>
                                <span ng-show="taskCount.status2>0" ></span>
                                <i class="icon-check pull-right filter-close" ></i>
                            </a>
                        </li>
                        </ul>
                    </div>
                    <div style="padding-left:10px;margin-bottom: 5px;"  >
                        <span class="text-info"  > <div style="padding-top:10px;padding-bottom:10px;"  ><b ><i class="fa fa-angle-down" ></i>&nbsp;&nbsp;{{'tasks.nav.label'|translate}}</b></div></span>
                        <ul class="nav nav-pills nav-stacked nav-sm">
                            <li ng-class="labelFilterClass('urgent')" >
                                <a ng-click="setLabel('urgent')" >
                                    <span>{{'tasks.nav.urgent'|translate}}</span>&nbsp;&nbsp;<i class="glyphicon glyphicon-flash icon "></i>
                                    <i class="icon-check pull-right filter-close" ></i>
                                </a>

                            </li>
                            <li ng-class="labelFilterClass('overdue')" >
                                <a ng-click="setLabel('overdue')" >
                                    <span >{{'tasks.nav.overdue'|translate}}</span>&nbsp;&nbsp;<i class="glyphicon glyphicon-time icon "></i>
                                    <i class="icon-check pull-right filter-close" ></i>
                                </a>
                            </li>
                            <li ng-class="labelFilterClass('favorite')" >
                                <a ng-click="setLabel('favorite')" >
                                    <span>{{'tasks.nav.favorite'|translate}}</span>&nbsp;&nbsp;<i class="glyphicon glyphicon-star icon "></i>
                                    <i class="icon-check pull-right filter-close" ></i>
                                </a>
                            </li>
                            <li ng-class="labelFilterClass('day')" >
                                <a ng-click="setLabel('day')" >
                                    <span>{{'tasks.nav.day'|translate}}</span>&nbsp;&nbsp;<i class="glyphicon  glyphicon-ok-circle icon "></i>
                                    <i class="icon-check pull-right filter-close" ></i>
                                </a>
                            </li>


                        </ul>
                    </div>

                </div>
            </div>
            <div class="col" >
                <div class="wrapper bg-light lter b-b" style="height:61px;">
                    <ul class="breadcrumb" style="display: block;float:left;background:none;">
                        <li><a ui-sref="app.news" ><i class="iconfont icon-xinwen"></i> {{'aside.nav.news'|translate}}</a></li>
                        <li class="active"><i class="fa fa-tasks"></i> {{'aside.nav.tasks'|translate}}</li>
                    </ul>
                    <div class="pull-right m-r-sm " style="margin-top: 8px;" >
                        <span ng-show="statusFilter!=null" >{{'tasks.status.'+statusFilter|translate}}</span>
                        <span ng-show="labelFilter!=null" >{{'tasks.nav.'+labelFilter|translate}}</span>
                        <span ng-show="searchValue!=null&&searchValue!=''" >{{'common.search'|translate}} {{searchValue}}</span>
                        <span ng-show="statusFilter==null&&labelFilter==null&&(searchValue==null||searchValue=='')" >{{'tasks.nav.all'|translate}}</span>
                        {{'common.general'|translate}} {{totalCount}} {{'tasks.barTask'|translate}}
                    </div>

                </div>
                <div class=""  >
                    <div class="">
                        <table class="table table-striped b-t b-light">
                            <thead>
                            <tr>
                                <th style="width:5px;padding: 0;"></th>
                                <!--<th style="width:10px;padding-right: 10px;">
                                    <label class="i-checks m-b-none">
                                        <input type="checkbox"><i></i>
                                    </label>
                                </th>-->
                                <th >&nbsp;&nbsp;&nbsp;{{'tasks.taskName'|translate}}</th>
                                <th style="width: 100px;">{{'tasks.statusLabel'|translate}}</th>
                               <!-- <th style="width:300px;" >{{'tasks.sourceProcess'|translate}}</th>-->
                                <th>{{'tasks.initiator'|translate}}</th>
                                <th>{{'tasks.startTime'|translate}}</th>
                                <th>{{'tasks.deadline'|translate}}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="task in tasks" class="tasks" id="task_{{task.id}}" ng-click="showTaskForm(task.id)" >
                                <td ng-show="task.priority==2" style="padding: 0;vertical-align: top;background-color: #f05050;" ></td>
                                <td ng-show="task.priority==1" style="padding: 0;vertical-align: top;background-color: #ff9800;" ></td>
                                <td ng-show="task.priority==0" style="padding: 0;vertical-align: top;" ></td>
                               <!-- <td style="padding-right: 10px;" ><label class="i-checks m-b-none"><input type="checkbox" name="post[]"><i></i></label></td>-->
                                <td style="white-space: nowrap;" >
                                    <a href ui-toggle-class class="m-xs" style="font-size: 15px;" ng-click="setFavorite(task.id,task.favorite,$event)" ng-class="isFavorite(task.favorite)" >
                                        <i class="fa fa-star text-warning text-active" ></i>
                                        <i class="fa fa-star-o  text" style="color:#98a6ad;"  ></i>
                                    </a>&nbsp;
                                    <a class="" href="#/app/taskdetail/{{task.id}}" ><span ng-bind-html="task.name"></span></a>
                                </td>
                                <td><span class="label" ng-class="taskStatusBg(task.status)" >{{'tasks.status.'+task.status|translate}}</span></td>
                                <!-- <td><a class="" href="#/app/processdetail/{{task.ppid}}" ><span ng-bind-html="task.ppname"></span></a> </td>-->
                                <td>
                                    <a class="thumb-xs avatar m-r-xs" href="#/app/userprofile/{{task.initiator.userName}}" >
                                        <img ng-src="/suite/plugins/servlet/getUserAvatar?user={{userInfo.userName}}" class="img-circle" alt="...">
                                    {{task.initiator.firstName}}</a></td>
                                <td>{{task.startdate | fromNow}}</td>
                                <td><i ng-show="task.overdue" class="iconfont icon-naozhonglingsheng icon-max text-danger"  ></i>&nbsp;
                                    <span ng-show="task.deadline!=null&&task.deadline!=''" >{{task.deadline | fromNow}}</span>
                                    <span ng-show="task.deadline==null||task.deadline==''" >-</span></td>
                            </tr>
                            <tr ng-show="tasks.length==0" >
                                <td colspan="6" style="background-color: #f0f3f4;" >
                                    <div   style="text-align: center;margin-top: 30px;" ><i class="iconfont  icon-meiyousoudaoxinxi" style="font-size: 23px;" ></i>&nbsp;&nbsp;{{'tasks.noTask'|translate}}</div>
                                </td>
                            </tr>
                            </tbody>

                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>

</div>